﻿@model IEnumerable<EasyBlog.Models.InfoBlog>

@{
    ViewData["Title"] = "我的博客";
    int rowindex = 0;
}

<h1>@ViewData["Title"]</h1>

<p>
    <a asp-action="Create">新增</a>
</p>
<table class="table">
    <thead>
        <tr>
            <th>序号</th>
            <th>
                @Html.DisplayNameFor(model => model.Title)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.VisitCount)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.DTCreate)
            </th>
            <th>操作</th>
        </tr>
    </thead>
    <tbody>
        @foreach (var item in Model)
        {
            rowindex++;
            <tr>
                <td>@rowindex</td>
                <td>
                    @Html.DisplayFor(modelItem => item.Title)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.VisitCount)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.DTCreate)
                </td>
                <td>
                    <a asp-action="Edit" asp-route-id="@item.ID">编辑</a> |
                    <a asp-action="Delete" asp-route-id="@item.ID">删除</a>
                </td>
            </tr>
        }
    </tbody>
</table>
